#!/bin/bash

echo -e "\e[1;33m[root@localhost ~]# lsblk\e[0m"
lsblk
echo -e "\e[1;33m[root@localhost ~]# nvme list\e[0m"
nvme list

nvme list | grep "/dev/nvme" | while read line; do
    device=$(echo $line | awk '{print $1}')
    echo -e "\e[1;33m[root@localhost ~]# smartctl -i $device\e[0m"
    # 使用 smartctl 命令获取基本信息
    smartctl -i $device
    done
